package com.tiancheng.trade.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tiancheng.trade.commom.core.data.PageInfo;
import com.tiancheng.trade.commom.core.data.notify.PayRefundSettleResultMsgBO;
import com.tiancheng.trade.commom.core.data.notify.PaySettleResultMsgBO;
import com.tiancheng.trade.order.bo.cmq.RefundResultMsgBO;
import com.tiancheng.trade.order.bo.notify.PayResultOrderBO;
import com.tiancheng.trade.order.model.Bill;
import com.tiancheng.trade.order.model.Order;
import com.tiancheng.trade.order.model.RefundOrdersDetail;
import com.tiancheng.trade.order.vo.admin.res.BillQueryResVO;
import com.tiancheng.trade.order.vo.admin.QueryBillReqVO;

import java.util.List;

/**
 * @Author: kellen
 * @Description: 账单 service
 * @Date: create in 2024/12/17 15:44
 */
public interface BillService extends IService<Bill> {
    /**
     * 支付通知创建账单，支付成功后触发
     *
     * @param order            主订单信息
     * @param payResultOrderBO 支付消息
     * @return
     */
    Boolean createAfterPay(Order order, PayResultOrderBO payResultOrderBO);

    /**
     * 添加账单明细项，退款成功后触发
     *
     * @param order             主订单信息
     * @param refundResultMsgBO 退款消息
     * @param refundOrdersDetails 退款明细消息
     * @return
     */
    Boolean createBillAfterRefund(Order order, RefundResultMsgBO refundResultMsgBO, List<RefundOrdersDetail> refundOrdersDetails);

    /**
     * 支付账单账单完成
     * @param paySettleResultMsgBO
     * @return
     */
    Boolean paymentSettleResult(PaySettleResultMsgBO paySettleResultMsgBO);

    /**
     * 退款账单结算完成通知
     * @param refundSettleResultMsgBO
     * @return
     */
    Boolean refundSettleResult(PayRefundSettleResultMsgBO refundSettleResultMsgBO);

    /**
     * 退款单核销
     * @param refundOrdersDetails 退款单明细
     */
    void refundVerification(List<RefundOrdersDetail> refundOrdersDetails);

    PageInfo<BillQueryResVO> queryPage(QueryBillReqVO params);
}
